<script setup lang="ts">
defineProps({
  //xlink:href属性值的前缀
  prefix: {
    type: String,
    default: '#icon-',
  },
  //使用图标的名字
  name: String,
  //接收父组件传递的颜色
  color: {
    type: String,
    default: '',
  },
  //接收父组件传递过来的图标的宽度
  width: {
    type: String,
    default: '16px',
  },
  height: {
    type: String,
    default: '16px',
  },
})
</script>

<template>
  <svg :width="width" :height="height">
    <use :xlink:href="prefix + name" :fill="color"></use>
  </svg>
</template>

<style scoped></style>
